-- GENERATED SPELL FOR [Vekh'nir Matriarch] --


function spell0_20161(pUnit, Event) --@Arakkoa Egg,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(35784,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_20161', 1, 1)
end

function spell1_20161(pUnit, Event) --@Impending Doom,n/a--
pUnit:FullCastSpellOnTarget(37579,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20161', 30000, 1)
end

function spell2_20161(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20161', 3000, 1)
end

function spell3_20161(pUnit, Event) --@Shadow Mend,Heal--
pUnit:FullCastSpellOnTarget(34110,pUnit)
pUnit:RegisterEvent('Sorts_20161', 2500, 1)
end

function Sorts_20161(pUnit, Event)
local choix_sorts_20161 = math.random(0, 3)
if choix_sorts_20161 == 0 then
pUnit:RegisterEvent('spell0_20161', 1, 1)
end
if choix_sorts_20161 == 1 then
pUnit:RegisterEvent('spell1_20161', 1, 1)
end
if choix_sorts_20161 == 2 then
pUnit:RegisterEvent('spell2_20161', 1, 1)
end
if choix_sorts_20161 == 3 then
pUnit:RegisterEvent('spell3_20161', 1, 1)
end
end

function mob20161_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20161', math.random(1500, 3000), 1)
end

function mob20161_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20161_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20161_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20161, 1, 'mob20161_Action')
RegisterUnitEvent(20161, 2, 'mob20161_Leave')
RegisterUnitEvent(20161, 3, 'mob20161_Kill')
RegisterUnitEvent(20161, 4, 'mob20161_Die')
